package cn.icanci.controller.superadmin;

import cn.icanci.entity.bo.ShopCategory;
import cn.icanci.entity.dto.Result;
import cn.icanci.service.solo.ShopCategoryService;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.simpleframework.core.annotation.Controller;
import org.simpleframework.inject.annotation.Autowired;

/**
 * 店铺管理Controller
 *
 * @author icanci
 * @date Created in 2021/02/04 00:13
 * @version 1.0
 */
@Controller
public class ShopCategoryOperationController {
    @Autowired
    private ShopCategoryService shopCategoryService;

    public Result<Boolean> addShopCategory(HttpServletRequest req, HttpServletResponse resp) {
        // TODO:参数检验和请求参数转换
        return shopCategoryService.addShopCategory(new ShopCategory());
    }

    public Result<Boolean> removeShopCategoryById(HttpServletRequest req, HttpServletResponse resp) {
        // TODO:参数检验和请求参数转换
        return shopCategoryService.removeShopCategoryById(1);
    }

    public Result<Boolean> modifyShopCategory(HttpServletRequest req, HttpServletResponse resp) {
        // TODO:参数检验和请求参数转换
        return shopCategoryService.modifyShopCategory(new ShopCategory());
    }

    public Result<ShopCategory> queryShopCategoryById(HttpServletRequest req, HttpServletResponse resp) {
        // TODO:参数检验和请求参数转换
        return shopCategoryService.queryShopCategoryById(1);
    }

    public Result<List<ShopCategory>> queryShopCategory(HttpServletRequest req, HttpServletResponse resp) {
        // TODO:参数检验和请求参数转换
        return shopCategoryService.queryShopCategory(new ShopCategory(), 1, 100);
    }
}
